// 1.引入
import VueRouter from 'vue-router'
import Vue from 'vue'

// 2.注册
Vue.use(VueRouter)
// 3.初始化
const router = new VueRouter({
  routes: [
    {
      path: '/login',
      component: () => import('../views/login/login.vue')
    },
    {
      path: '/layout',
      component: () => import('../views/layout/layout.vue'),
      children: [
        {
          path: 'home',
          component: () => import('../views/home/home.vue')
        },
        {
          path: 'article',
          name: 'article',
          component: () => import('../views/article/article.vue')
        },
        {
          path: 'publish',
          name: 'publish',
          component: () => import('../views/publish/publish.vue')
        }
      ]
    }
  ]
})
// 4.导出路由实例
export default router
// 5.导入路由实例 main.js
// import router from '@/router'
// 6.挂载 main.js
// new Vue({
//   render: h => h(App),
// }).$mount('#app')
